<template>
    <el-card class="box-card" style="height: 490px;width: 560px;margin-left: auto;">
        <el-table :data="tableData" border style="width: 100%">
            <el-table-column type="index" :index="indexMethod" label="排名" width="80" />
            <el-table-column prop="studentNo" label="学号" width="160" />
            <el-table-column prop="studentName" label="姓名" width="80" />
            <el-table-column prop="time" label="所用时间" width="120" />
            <el-table-column prop="score" label="分数" />
        </el-table>
    </el-card>
</template>

<script>
import axios from 'axios';
export default {
    data() {
        var tableData = []

        return {
            tableData
        }
    },
    mounted(){
        setInterval(()=> {
            console.log("xxxx")
            this.rank()
        }, 1000)

        // this.rank()

        // 测试数据
        // axios.get("http://1.12.77.253:8080/teacher/question").then((result) => {
        //     console.log("result", result)
        //     this.tableData = result.data
        //     console.log("result", this.tableData)
        // });

    },
    methods: {
        rank() {
            axios.get("http://1.12.77.253:8080/common/rank").then((result) => {
                console.log(result.data)
                this.tableData = result.data
            });
        }
    }

}
</script>

<style scoped>

</style>